<template>
  <div class="user-basic">
    <el-form :model="props.user" label-width="120px">
      <el-form-item>
        <el-avatar shape="square" :size="64" :src="props.user.avatar"/>
      </el-form-item>
      <el-form-item label="OpenID">
        <el-input v-model="props.user.openid" disabled/>
      </el-form-item>
      <el-form-item label="昵称">
        <el-input v-model="props.user.nickname" disabled/>
      </el-form-item>
      <el-form-item label="会员等级">
        <el-radio-group v-model="props.user.level">
          <el-radio :label="0">普通</el-radio>
          <el-radio :label="1">黄金</el-radio>
          <el-radio :label="2">铂金</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="性别">
        <el-radio-group v-model="props.user.gender">
          <el-radio :label="0">保密</el-radio>
          <el-radio :label="1">男　</el-radio>
          <el-radio :label="2">女　</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item label="手机号">
        <el-input v-model="props.user.phone" disabled/>
      </el-form-item>
      <el-form-item label="我的积分">
        <el-input v-model="props.user.integral" disabled/>
      </el-form-item>
      <el-form-item label="我的余额">
        <el-input v-model="props.user.balance" disabled/>
      </el-form-item>
      <el-form-item label="可提现余额">
        <el-input v-model="props.user.withdraw" disabled/>
      </el-form-item>
      <el-form-item label="注册时间">
        <el-input v-model="created_at" disabled/>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup>
import { computed, defineProps } from "vue";
import { toDateTime } from "../../utils";

const props = defineProps({
  user: Object,
})

const created_at = computed(() => {
  return toDateTime(props.user.created_at)
})

</script>

<style scoped>

</style>
